#ifndef BARCODE_EAN13_IO_HPP_INCLUDED
#define BARCODE_EAN13_IO_HPP_INCLUDED

#include "ean13_types.hpp"

#include <iostream>

namespace barcode
{

inline std::ostream& operator<<( std::ostream& out_, const ean13& ean13_ )
{
	out_ << to_string( ean13_ );
	return out_;
}

inline std::istream& operator>>( std::istream& in_, ean13& ean13_ )
{
	std::string string_code_;
	in_ >> string_code_;

	ean13( string_code_ ).swap( ean13_ );

	return in_;
}

}

#endif //BARCODE_EAN13_IO_HPP_INCLUDED
